package com.yanqu.road.entity.cmd;

public class CmdStatisticsData {
    private int code;
    private long totalTimes;
    private long totalExecuteTime;

    public CmdStatisticsData(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public long getTotalTimes() {
        return totalTimes;
    }

    public void setTotalTimes(long totalTimes) {
        this.totalTimes = totalTimes;
    }

    public long getTotalExecuteTime() {
        return totalExecuteTime;
    }

    public void setTotalExecuteTime(long totalExecuteTime) {
        this.totalExecuteTime = totalExecuteTime;
    }

    public void addTotalTimes(int addTimes) {
        totalTimes += addTimes;
    }

    public void addTotalExecuteTime(long executeTime) {
        totalExecuteTime += executeTime;
    }

    public long getAvgTime() {
        if (totalTimes > 0) {
            return totalExecuteTime / totalTimes;
        }
        return 0;
    }
}
